home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / atoolbar.zip / ESTOOLS0.H < prev    next >
C/C++ Source or Header  |  1993-04-07  |  5KB  |  164 lines

  1. /*
  2.     ESTOOLS0.H -- limited header file for use with ESTOOLS.DLL
  3.     Copyright ⌐ Eugene Sokolov 1992, (516)632-7892,
  4.     esokolov@sbchm1.chem.sunysb.edu
  5.  
  6.     You can freely copy, change or redistribute this file as long
  7.     as this notice remains intact.
  8. */
  9. #ifndef __WINDOWS_H
  10. #define STRICT
  11. #include <windows.h>
  12. #endif /* __WINDOWS_H */
  13.  
  14. #ifndef __ESTOOLS_H
  15. #define __ESTOOLS_H
  16.  
  17. /* Tool Bar styles */
  18.  
  19. #define TBS_CHILD    0x0    // Translated into WS_CHILD -- default;
  20. #define TBS_POPUP    0x1    // Translated into WS_POPUP;
  21. #define TBS_MOVABLE    0x0    // Has caption -- default;
  22. #define TBS_FIXED    0x2    // No caption  -- ignored if TBS_POPUP set;
  23. #define TBS_NOBORDER    0x0    // No border around controls -- default;
  24. #define TBS_BORDER    0x4    // Has a border around controls
  25.                 // if it is clear, than value at TBP_BORDER
  26.                 // offset is ignored;
  27. #define TBS_VISIBLE    0x8    // Translated into WS_VISIBLE;
  28.  
  29.  
  30. /* Tool Bar button styles */
  31. #define TBB_STANDARD    0x0    // Standard Windows-like button -- default;
  32. #define TBB_AUTO2STATE    0x1    // Button remains depressed untill another button
  33.                 // in the same tool bar is pressed;
  34. #define TBB_2STATE    0x2    // Button remains depressed until it state is changed
  35.                 // by sending it a message TBM_CHANGEBTNSTATE -- you need to
  36.                 // register to know how it works or try to figure out yourself;
  37. #define TBB_STATIC    (TBB_AUTO2STATE | TBB_2STATE)
  38.                 //Combination of the two above
  39. #define TBB_DISABLED    0x4    // Button disabled (shadowed)
  40. #define TBB_PRESSED    0x8    // Button initially pressed
  41.  
  42. /* Base for messages */
  43. #define UNDEFINED   WM_USER+???      //it is defined in a real estools.h
  44. // Do not try to use any of these definitions in your program, they
  45. //will produce an error
  46.  
  47. /* Notification messges */
  48.  
  49. #define TBN_CHANGED UNDEFINED+16
  50.                     //
  51.                     //
  52.                     //
  53.                     //
  54.  
  55. /* Tool Bar messages -- need to register to use them or try to find out */
  56. #define TBM_BASE       UNDEFINED
  57. #define TBM_SETBTNSTATE    (TBM_BASE)        //
  58. #define TBM_GETBTNSTATE    (TBM_BASE+1)      //
  59. #define TBM_SETBTNSTYLE    (TBM_BASE+2)        //        The
  60. #define TBM_GETBTNSTYLE    (TBM_BASE+3)        //   explanation for
  61. #define TBM_SETTBSTYLE       (TBM_BASE+4)        //   these messages
  62.                         //   is placed here
  63.                         //    in the real
  64.                         //     estools.h.
  65.                         //
  66.                         //
  67.                         //
  68.                         //
  69.                         //
  70. #define TBM_GETTBSTYLE       (TBM_BASE+5)        //
  71.                         //
  72.                         //
  73. #ifndef RC_INVOKED
  74. /* Structures describing the header of TB resource */
  75. typedef struct tagToolBarControl
  76. {
  77.    UINT tbcBmp;           //Bitmap resource ID
  78.    UINT tbcMsg;           //Button ID
  79.    UINT    tbcStl;           //Button style
  80. }TBCONTROLSTRUCT;
  81. typedef TBCONTROLSTRUCT FAR* LPTBCONTROLSTRUCT;
  82.  
  83. typedef struct tagTBResourceHeader
  84. {
  85.    UINT nWndName;         // String ID -- identifies TB's name
  86.    WORD wStyle;           // TB style
  87.    int  nXSize;           // Button width
  88.    int  nYSize;           // Button height
  89.    int  nBorder;          // Border size
  90.    int  nRowLen;          // Number of button per horozontal row.
  91.    int  nCtrl;            // Total number of buttons
  92.    TBCONTROLSTRUCT tbcsCtrl[1];  //Individual buttons.
  93. }TBRESOURCEHEADER;
  94. typedef TBRESOURCEHEADER FAR* LPTBRESOURCEHEADER;
  95.  
  96. /* Functions exported from estools.dll */
  97.  
  98. /*
  99.    UINT  CALLBACK ESToolBarVers    ( VOID );
  100.    Retrieves a version number of DLL.
  101.    DLL version.
  102.  
  103.    Parameters:
  104.       NONE.
  105.    Returns:
  106.       DLL version number, in hexadecimal. Current version is 1.0,
  107.       this function returns 0x100. For example for the version
  108.       3.21 it will return 0x321.
  109. */
  110. UINT  CALLBACK    ESToolBarVers    ( VOID );
  111.  
  112. /*
  113.    HWND CALLBACK CreateToolBar( HINSTANCE hInst, LPSTR lpszTemplate,
  114.       HWND hwndParent, POINT pntPosition );
  115.    Creates a tool bar control.
  116.  
  117.    Parameters:
  118.       hInst:        Instance handle (must be an instance of application,
  119.             NOT library);
  120.       lpszTemplate:    Pointer to the null terminated name of the TB template.
  121.       hwndParent:    Parent window of the TB control.
  122.       pntPosition:      Initial position of the TB control. Pay attention,
  123.             is is a POINT struct itself, not a pointer, do not
  124.             try to supply NULL.
  125.    Returns:
  126.       On sucsess returns a window handle of the TB control, NULL otherwise.
  127. */
  128. HWND CALLBACK    CreateToolBar    ( HINSTANCE, LPSTR, HWND, POINT );
  129.  
  130. /*
  131.    BOOL CALLBACK DeleteToolBar( HWND hwnd );
  132.    Destroys the tool bar. This function is called when the TB
  133.    window reseives WM_DESTROY message.
  134.  
  135.    Parameters:
  136.       hwnd:        Window handle of the TB control to be destroyed
  137.    Returns:
  138.       On sucsess returns TRUE, FALSE otherwise.
  139. */
  140. BOOL CALLBACK     DeleteToolBar    ( HWND );
  141.  
  142. /*
  143.    int  CALLBACK GetButtonNumber( HWND hwnd, UINT nId );
  144.    Retrieves the button number from it's ID number,
  145.    analogous to GetDlgItem except that the TB buttons
  146.    are not individual windows and consequently do not have
  147.    handles.
  148.  
  149.    Parameters:
  150.       hwnd:    TB window handle;
  151.       nId    Button ID (equal to the wParam of WM_COMMAND from
  152.         the corresponding button, or second parameter (tbsMsg)
  153.         in the TB resource).
  154.    Returns:
  155.       Button number, which can be used to change button's state or style.
  156.       If no button with such ID exists function returns -1. If several
  157.       buttons share the same ID it returns first it encounters.
  158.  
  159. */
  160. int  CALLBACK    GetButtonNumber    ( HWND, UINT );
  161.  
  162. #endif /* RC_INVOKED */
  163.  
  164. #endif /* __ESTOOLS_H */